﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace SDT.Admin
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : System.Web.HttpApplication
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            ///
            /// Author: Admin
            /// Date: 
            /// For type: /Controller/Action/id
            ///
            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = 0 } // Parameter defaults
            );
            ///
            /// Author: Vietlv  
            /// Date:12/08/2011 
            /// For type: /Controller/Action/value
            ///
            //routes.MapRoute(
            //    "Default_value",
            //    "{controller}/{action}/{value}",
            //    new { controller = "Home", action = "Index", value= string.Empty}
            //    );
            /// 
            ///
            /// Author: Takamaru Nguyen
            /// Date: 21/06/2011
            /// For type: /Controller/Action/id/pubYN
            ///
            routes.MapRoute(
                "Default_id_bool", // Route name
                "{controller}/{action}/{id}/{pubYN}", // URL with parameters
                new
                {
                    controller = "Home",
                    action = "Index",
                    id = 0,
                    pubYN = false
                } // Parameter defaults
            );

        }

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterRoutes(RouteTable.Routes);
        }
    }
}